#include "display.h"
#include "stdlib.h"
uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {  //1x1
  {64}      //点阵IIC地址
};

Matrix dis = Matrix(Addr, TYPE_COLOR); //TYPE_COLOR or TYPE_S2
int dis_arr[8]={0,0,0,0,0,0,0,0};
void display_init()
{
  dis.setBrightness(255);
  dis.clearDisplay();
}

void dis_add_data(int ndata)
{
  for(int i=7;i>=1;i--)
  {
    dis_arr[i]=dis_arr[i-1];
  }
  dis_arr[0]=ndata;
}
void display(int ndata)
{
  dis_add_data(ndata);
  dis.clearDisplay();
  for(int i=0;i<8;i++)
  {
    
    dis.setColor(random(0,256), random(0,256), random(0,256));
    dis.drawLine(i,0 , i, dis_arr[i]); //x,y,x1,y1
  }
}

